package org.feng.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.feng.base.entity.BaseEntity;

import java.io.Serializable;
import java.util.List;

@TableName("sys_menu")
@Data
public class Menu extends BaseEntity implements Serializable {

    @JsonSerialize(using = ToStringSerializer.class)
    @TableField("parent_id")
    private Long parentId;

    @TableField("name")
    private String name;

    @TableField("code")
    private String code;

    @TableField("path")
    private String path;

    @TableField("source")
    private String source;

    @TableField("sort")
    private Integer sort;

    @TableField("category")
    private Integer category;

    @TableField("link")
    private Integer link;

    @TableLogic
    @TableField("is_deleted")
    private Integer isDeleted;

    @TableField("keep_alive")
    private Integer keepAlive;

    @TableField(exist = false)
    private List<Menu> children;
}
